package service.impl;

import bean.dto.LogQueryPage;
import bean.vo.LogsVO;
import dao.LogDao;
import dao.impl.LogDaoImpl;
import service.LogService;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * service.impl
 * User: mcw
 * Date: 2024/12/19 下午2:12
 * motto:   春天（spring）没有虫子（bug)
 * Description:
 * Version: V1.0
 */
public class LogServiceImpl implements LogService {
    private LogDao logDao=new LogDaoImpl();

    /**
     * 查询记录数
     * @param queryPage
     * @return
     */
    @Override
    public Long findByTotal(LogQueryPage queryPage) {
        return logDao.findByTotal(queryPage);
    }

    /**
     * 分页查询
     * @param queryPage
     * @return
     */
    @Override
    public List<LogsVO> findByPage(LogQueryPage queryPage) {
        return logDao.findByPage(queryPage);
    }

    /**
     * 根据id 删除日志
     * @param logId
     * @return
     */
    @Override
    public boolean deleteById(Integer logId) {
        return logDao.deleteById(logId);
    }

    /**
     * 删除所有日志信息
     * @return
     */
    @Override
    public boolean deleteAllLogs() {
        return logDao.deleteAllLogs();
    }

    /**
     * 插入日志
     * @param userId
     */
    @Override
    public void insert(Integer userId,String userName,String operationType, LocalDateTime operationTime) {
         logDao.insert(userId,userName,operationType,operationTime);
    }
}
